package org.jeecg.modules.interfaceMapping.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.interfaceMapping.entity.InterfaceMapping;
import org.jeecg.modules.interfaceMapping.mapper.InterfaceMappingMapper;
import org.jeecg.modules.interfaceMapping.service.IInterfaceMappingService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 接口地址映射
 * @Author: jeecg-boot
 * @Date:   2024-07-31
 * @Version: V1.0
 */
@Service
public class InterfaceMappingServiceImpl extends ServiceImpl<InterfaceMappingMapper, InterfaceMapping> implements IInterfaceMappingService {

    @Override
    public InterfaceMapping getUrlByLocation(String location) {
        LambdaQueryWrapper<InterfaceMapping> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(InterfaceMapping::getCompany, location);
        return baseMapper.selectOne(wrapper);
    }
}
